feat(agentos): group-scoped encrypted git PATs + GAP source SHA sync#28
Merged
Merged
Conversation
Let the SDK clone private GAP repos with a group-owned PAT, stored encrypted on the AgentOS server and fetched with the SDK's API key. Server: - crypto/secret-box.ts — AES-256-GCM at rest, keyed by AGENTOS_CREDENTIALS_KEY, with kid-based rotation (AGENTOS_CREDENTIALS_KEY_OLD). Fails closed. - stores/git-credential-store.ts — git_credentials collection, unique (ownerGroup, host) (re-upsert = rotation), normalizeGitHost, resolve(). - routes/git-credentials.ts — CRUD (git-credentials:manage/:read, ownership) + POST /resolve for the SDK's cak_ key (strictly group-scoped, no admin bypass, no-store, token never logged). Mounted in the dashboard router. - permissions + agentos-editor seed; ensureIndexes wiring. - SHA sync: RegistryDoc.sourceSha/sourceSyncedAt, written from session_started payload.agent_sha; drift since the last run is logged. - tests: secret-box + git-credential-store. SPA: - api.gitCredentials client + GitCredential type; Settings -> Git Credentials section (write-only secret) gated on git-credentials:read/:manage. Ops: - scripts/provision-keycloak.mjs (pnpm provision:keycloak) — idempotent realm / roles / OIDC client / mappers / service-account provisioning. - .gitignore: ignore *.env (keycloak.env etc.). - CLAUDE.md: document auth/RBAC (§2.6b), git credentials + SHA sync (§2.6c), new collections, and all new env vars. Note: clone-with-PAT is wired for the SDK LOCAL/library substrate. The remote (sandbox-at-CAS) and AgentOS->CAS dashboard paths reuse CAS's existing gitToken field and are a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let the SDK clone private GAP repos with a group-owned PAT, stored encrypted on the AgentOS server and fetched with the SDK's API key.
Server:
SPA:
Ops:
Note: clone-with-PAT is wired for the SDK LOCAL/library substrate. The remote (sandbox-at-CAS) and AgentOS->CAS dashboard paths reuse CAS's existing gitToken field and are a follow-up.
Summary
Type of change
Verification
pnpm -r buildcleanpnpm -r typecheckcleanpnpm -r testclean (note any flaky tests in the comment)runConformanceSuite()passes (paste report below)Versioning
pnpm changesetwas run for any change to a published packageNotes for the reviewer